<?php

namespace addons\shopro\controller\teams;

use addons\shopro\controller\Base;
use addons\shopro\library\teams\Config as ConfigLibrary;

class Commission extends Base
{

    protected $noNeedLogin = [];
    protected $noNeedRight = ['*'];
    protected $agent;


    public function _initialize()
    {

        parent::_initialize();
        $this->config = new ConfigLibrary();
        $user = $this->auth->getUserinfo();
//        if($user['is_heads'] == 0) {
//            $this->success('您还没有成为团长', [
//                'status' => 'unmet',
//                'msg' => '您还没有成为团长'
//            ]);
//        }

        if($user['is_heads'] == 1 && $user['heads_status'] == 0) {
            $this->success('您的账户被禁用', [
                'status' => 'forbidden',
                'msg' => '您的账户被禁用'
            ]);
        }
    }
}
